DEV-5629 Support fallback rates in Magento#8
Merged
Conversation
ammesonb
approved these changes
Aug 28, 2025
Model/Api.php
Outdated
Comment on lines
+551
to
+556
| $customerAddress = $customerAddressFactory->create(); | ||
| $customerAddress->setCountryId($address->getCountryId()); | ||
| $customerAddress->setRegionId($address->getRegionId()); | ||
| $customerAddress->setPostcode($address->getPostcode()); | ||
| $customerAddress->setCity($address->getCity()); | ||
| $customerAddress->setStreet($address->getStreet()); |
There was a problem hiding this comment.
Not sure it's an "improvement", but would it make sense to have a setFromAddress method that does all this internally?
added 6 commits
September 12, 2025 15:47
- Add _isFallbackToMagentoEnabled() method to check configuration - Add setFromAddress() helper method for customer address handling - Update FallbackToMagentoTest.php with comprehensive test coverage - Support fallback to Magento tax calculation when TaxCloud fails
- Fix undefined property error: change _client to client in Api.php - Fix multi-line function call formatting in processAndApplyCartItemResponses - Fix line length warnings by breaking long lines across multiple lines - Improve code readability with proper PSR-2 formatting
hasanali33
reviewed
Oct 8, 2025
| try { | ||
| // Use reflection to check if the required constants exist | ||
| $reflection = new \ReflectionClass(Api::class); | ||
| $constants = $reflection->getConstants(); |
There was a problem hiding this comment.
Cool how ReflectionClass has a built-in getConstants() method. I’m used to just writing getters/setters, but this seems much more flexible.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
We don't currently support fallback rates in magento. This adds a setting that will attempt to use the rates defined in magento if shipping lookup fails.